#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[10005];
int ef(){
	int left = 1, right = n;
	while(left <= right){
		int mid = (left + right) / 2;
		if(a[mid] == m)return mid;
		else if(a[mid ] < m)left = mid + 1;
		else right = mid - 1;
	}
	return -1;
}
int main(){
	cin >> n;
	for(int i = 1;i <= n;i++)
		cin >> a[i];
	cin >> m;
	cout << ef();
	
	return 0;
}